package com.qingjiang.projectschedule.controller;

import com.qingjiang.projectschedule.pojo.User;
import com.qingjiang.projectschedule.service.UserService;
import com.qingjiang.projectschedule.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("user")
@CrossOrigin
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping("login")
    public Result login(@RequestBody User user){
        return userService.login(user);
    }

    @PostMapping("login_new")
    public Result login_new(@RequestBody Map map){
        return userService.login_new(map);

    }
}
